package com.eightbears.beboy.entity;

import android.text.TextUtils;

import com.eightbears.beboy.base.BaseEntity;
import com.eightbears.beboy.base.util.CommonUtils;

import java.io.Serializable;
import java.util.List;

/**
 * Created by baoga on 2017/7/2.
 */

public class UserEntity extends BaseEntity implements Serializable {

    public static final String LOCATION_SHOP_MANAGER = "1";
    public static final String LOCATION_MANAGER = "2";


    private User data;

    public User getData() {
        return data;
    }

    public void setData(User data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "UserEntity{" +
                "data=" + data +
                '}';
    }

    public static class User implements Serializable {

        private String user_id;
        private String nickname;
        private String email;
        private String cover;
        private String status;
        private String access_token;
        private String refresh_token;
        private String is_auth;
        private String is_admin;
        private String is_guest;
        private String is_agent;
        private String birthday;
        private String true_name;
        private String sign;
        private String sex;
        private String mobile;
        private int vip_level;
        private String vip_validity;
        private String balance;
        private String unique_id;
        private String guest_id;
        private String mobile_city_id;
        private String agent_city_id;
        private String district_id;
        private String longitude;
        private String latitude;
        private String chatPass;
        private String third_party;
        private Points points;

        public Points getPoints() {
            return points;
        }

        public void setPoints(Points points) {
            this.points = points;
        }

        private List<Shop> shops;

        public String getSex() {
            return sex;
        }

        public String getChatPass() {
            return CommonUtils.getMD5(getUser_id());
        }

        public void setChatPass(String chatPass) {
            this.chatPass = chatPass;
        }

        public List<Shop> getShops() {
            return shops;
        }

        public void setShops(List<Shop> shops) {
            this.shops = shops;
        }

        public String getAccess_token() {
            return access_token;
        }

        public void setAccess_token(String access_token) {
            this.access_token = access_token;
        }

        public String getRefresh_token() {
            return refresh_token;
        }

        public void setRefresh_token(String refresh_token) {
            this.refresh_token = refresh_token;
        }

        public String getUser_id() {
            return user_id == null ? "" : user_id;
        }

        public void setUser_id(String user_id) {
            this.user_id = user_id;
        }

        public String getNickname() {
            return nickname == null ? "" : nickname;
        }

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public String getEmail() {
            return email == null ? "" : email;
        }

        public void setEmail(String email) {
            this.email = email;
        }

        public String getCover() {
            return cover == null ? "" : cover;
        }

        public void setCover(String cover) {
            this.cover = cover;
        }

        public String getStatus() {
            return status == null ? "" : status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getIs_auth() {
            return is_auth == null ? "" : is_auth;
        }

        public void setIs_auth(String is_auth) {
            this.is_auth = is_auth;
        }

        public String getIs_admin() {
            return is_admin;
        }

        public void setIs_admin(String is_admin) {
            this.is_admin = is_admin;
        }

        public String getIs_guest() {
            return is_guest;
        }

        public void setIs_guest(String is_guest) {
            this.is_guest = is_guest;
        }

        public String getIs_agent() {
            return is_agent;
        }

        public void setIs_agent(String is_agent) {
            this.is_agent = is_agent;
        }

        public String getBirthday() {
            return birthday == null ? "" : birthday;
        }

        public void setBirthday(String birthday) {
            this.birthday = birthday;
        }

        public String getTrue_name() {
            return true_name == null ? "" : true_name;
        }

        public void setTrue_name(String true_name) {
            this.true_name = true_name;
        }

        public String getSign() {
            return sign == null ? "" : sign;
        }

        public void setSign(String sign) {
            this.sign = sign;
        }

//        public String getSex() {
//            if(TextUtils.isEmpty(sex)) {
//                return "未知";
//            }
//            return sex.equals("1") ? "男" : "女";
//        }

        public void setSex(String sex) {
            this.sex = sex;
        }

        public String getMobile() {
            return mobile == null ? "" : mobile;
        }

        public void setMobile(String mobile) {
            this.mobile = mobile;
        }

        public int getVip_level() {
            return vip_level;
        }

        public void setVip_level(int vip_level) {
            this.vip_level = vip_level;
        }

        public String getVip_validity() {
            return vip_validity;
        }

        public void setVip_validity(String vip_validity) {
            this.vip_validity = vip_validity;
        }

        public String getBalance() {
            return balance;
        }

        public void setBalance(String balance) {
            this.balance = balance;
        }

        public String getUnique_id() {
            return unique_id == null ? "" : unique_id;
        }

        public void setUnique_id(String unique_id) {
            this.unique_id = unique_id;
        }

        public String getGuest_id() {
            return guest_id;
        }

        public void setGuest_id(String guest_id) {
            this.guest_id = guest_id;
        }

        public String getMobile_city_id() {
            return mobile_city_id;
        }

        public void setMobile_city_id(String mobile_city_id) {
            this.mobile_city_id = mobile_city_id;
        }

        public String getAgent_city_id() {
            return agent_city_id;
        }

        public void setAgent_city_id(String agent_city_id) {
            this.agent_city_id = agent_city_id;
        }

        public String getDistrict_id() {
            return district_id;
        }

        public void setDistrict_id(String district_id) {
            this.district_id = district_id;
        }

        public String getLongitude() {
            return longitude;
        }

        public void setLongitude(String longitude) {
            this.longitude = longitude;
        }

        public String getLatitude() {
            return latitude;
        }

        public void setLatitude(String latitude) {
            this.latitude = latitude;
        }

        public String getThird_party() {
            return third_party;
        }

        public void setThird_party(String third_party) {
            this.third_party = third_party;
        }

        @Override
        public String toString() {
            return "User{" +
                    "user_id='" + user_id + '\'' +
                    ", nickname='" + nickname + '\'' +
                    ", email='" + email + '\'' +
                    ", cover='" + cover + '\'' +
                    ", status='" + status + '\'' +
                    ", access_token='" + access_token + '\'' +
                    ", refresh_token='" + refresh_token + '\'' +
                    ", is_auth='" + is_auth + '\'' +
                    ", is_admin='" + is_admin + '\'' +
                    ", is_guest='" + is_guest + '\'' +
                    ", is_agent='" + is_agent + '\'' +
                    ", birthday='" + birthday + '\'' +
                    ", true_name='" + true_name + '\'' +
                    ", sign='" + sign + '\'' +
                    ", sex='" + sex + '\'' +
                    ", mobile='" + mobile + '\'' +
                    ", vip_level=" + vip_level +
                    ", vip_validity='" + vip_validity + '\'' +
                    ", balance='" + balance + '\'' +
                    ", unique_id='" + unique_id + '\'' +
                    ", guest_id='" + guest_id + '\'' +
                    ", mobile_city_id='" + mobile_city_id + '\'' +
                    ", agent_city_id='" + agent_city_id + '\'' +
                    ", district_id='" + district_id + '\'' +
                    ", longitude='" + longitude + '\'' +
                    ", latitude='" + latitude + '\'' +
                    ", chatPass='" + chatPass + '\'' +
                    ", third_party='" + third_party + '\'' +
                    ", shops=" + shops +
                    '}';
        }
    }


    public static class Shop implements Serializable {
        private String user_id;
        private String title;
        private String shop_id;
        private String level;

        public String getLevel() {
            return level;
        }

        public void setLevel(String level) {
            this.level = level;
        }

        public String getUser_id() {
            return user_id;
        }

        public void setUser_id(String user_id) {
            this.user_id = user_id;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getShop_id() {
            return shop_id;
        }

        public void setShop_id(String shop_id) {
            this.shop_id = shop_id;
        }

        @Override
        public String toString() {
            return "Shop{" +
                    "user_id='" + user_id + '\'' +
                    ", title='" + title + '\'' +
                    ", shop_id='" + shop_id + '\'' +
                    '}';
        }
    }


    public static class Points implements Serializable {
        private int point;
        private int total_point;
        private int level;
        private int point_to_next;

        public int getPoint() {
            return point;
        }

        public void setPoint(int point) {
            this.point = point;
        }

        public int getTotal_point() {
            return total_point;
        }

        public void setTotal_point(int total_point) {
            this.total_point = total_point;
        }

        public int getLevel() {
            return level;
        }

        public void setLevel(int level) {
            this.level = level;
        }

        public int getPoint_to_next() {
            return point_to_next;
        }

        public void setPoint_to_next(int point_to_next) {
            this.point_to_next = point_to_next;
        }
    }
}
